<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//Route::get('/', function () {
//    return view('welcome');
//});

//Route::get('/test', function(){
//    dd(env('OSS_ACCESS_KEY_ID', null),
//        env('OSS_ACCESS_KEY_SECRET', null));
//});


// 跨域问题在/bootstrap/app.php 解决了

Route::namespace('Api')->domain('api.tiaofu.vip')->prefix('api')->middleware(['check.token'])->group(function() {
    Route::post('login', 'Login@login');
    Route::post('checkLogin', 'Login@checkLogin');
    Route::get('loginOut', 'Login@out');

    Route::post('user/changePassWord', 'User@changePassWord');

    Route::get('index/getTurnover', 'Index@getTurnover');

    Route::get('index/getNotifyList', 'Index@getNotifyList');
    Route::post('index/notify/del', 'Index@notifyDel');
    Route::post('index/addExpend', 'Index@addExpend');

    Route::get('baseData/account/getAccountList', 'BaseData\Account@getList');
    Route::get('baseData/account/get', 'BaseData\Account@get');
    Route::post('baseData/account/add', 'BaseData\Account@add');
    Route::post('baseData/account/update', 'BaseData\Account@update');
    Route::post('baseData/account/del', 'BaseData\Account@del');

//    Route::get('baseData/unit/getUnitList');
//    Route::get('baseData/unit/get');
//    Route::post('baseData/unit/add');
//    Route::post('baseData/unit/update');
//    Route::post('baseData/unit/del');

    Route::get('baseData/consumable/getConsumableList', 'BaseData\Consumable@getList');
    Route::get('baseData/consumable/get', 'BaseData\Consumable@get');
    Route::post('baseData/consumable/add', 'BaseData\Consumable@add');
    Route::post('baseData/consumable/update', 'BaseData\Consumable@update');
    Route::post('baseData/consumable/del', 'BaseData\Consumable@del');

    Route::get('baseData/postPrint/getPostPrintList', 'BaseData\PostPrint@getList');
    Route::get('baseData/postPrint/get', 'BaseData\PostPrint@get');
    Route::post('baseData/postPrint/add', 'BaseData\PostPrint@add');
    Route::post('baseData/postPrint/del', 'BaseData\PostPrint@del');
    Route::post('baseData/postPrint/update', 'BaseData\PostPrint@update');


    Route::get('baseData/business/getBusinessList', 'BaseData\Business@getList');
    Route::get('baseData/business/get','BaseData\Business@get');
    Route::post('baseData/business/add', 'BaseData\Business@add');
    Route::post('baseData/business/del', 'BaseData\Business@del');
    Route::post('baseData/business/update', 'BaseData\Business@update');

    Route::get('customer/info/getCustomerList', 'Customer\Info@getList');
    Route::get('customer/info/getDebt', 'Customer\Info@getDebt');
    Route::get('customer/info/get', 'Customer\Info@get');
    Route::post('customer/info/add', 'Customer\Info@add');
    Route::post('customer/info/del', 'Customer\Info@del');
    Route::post('customer/info/update', 'Customer\Info@update');


    Route::get('customer/outsource/getOutsourceList', 'Customer\Outsource@getList');
    Route::get('customer/outsource/get', 'Customer\Outsource@get');
    Route::post('customer/outsource/add', 'Customer\Outsource@add');
    Route::post('customer/outsource/del', 'Customer\Outsource@del');
    Route::post('customer/outsource/update', 'Customer\Outsource@update');

    Route::get('customer/offer/get', 'Customer\Offer@get');
    Route::post('customer/offer/save', 'Customer\Offer@save');
    Route::get('outsource/offer/get', 'Customer\OutsourceOffer@get');
    Route::post('outsource/offer/save', 'Customer\OutsourceOffer@save');

    Route::post('business/order/createFast', 'Business\Order@createFast');
    Route::post('business/order/FastSK', 'Business\Order@FastSK');
    Route::post('business/order/create', 'Business\Order@create');
    Route::get('business/order/getOrderList', 'Business\Order@getList');
    Route::get('business/order/getOrderDetail', 'Business\Order@get');
    Route::post('business/order/payMoney', 'Business\Order@payMoney');
    Route::post('business/order/dump', 'Business\Order@dump');
    Route::post('business/order/changeStatus', 'Business\Order@changeStatus');
    Route::post('business/order/update', 'Business\Order@update');
    Route::post('business/order/SetComplete', 'Business\Order@SetMakeComplete');
    Route::post('business/order/SetDelivery', 'Business\Order@SetDelivery');
    Route::get('business/order/getOutsourceOrderList', 'Business\OutsourceOrder@getList');
    Route::post('business/outsourceOrder/setMake', 'Business\OutsourceOrder@setMake');
    Route::post('business/outsourceOrder/setTake', 'Business\OutsourceOrder@setTake');
    Route::get('business/order/getMakeBillList', 'Business\MakeBill@getList');
    Route::post('business/order/createMakeBill', 'Business\MakeBill@create');
    Route::get('business/order/getDeliveryBillList', 'Business\DeliveryBill@getList');
    Route::post('business/order/createDeliveryBill', 'Business\DeliveryBill@create');

    Route::get('business/order/getOutsourceBillList', 'Business\Order@getOutsourceBillList');
    Route::post('finance/customerBill/payAll', 'Finance\CheckBill@payAll');
    Route::post('finance/outsourceBill/update', 'Finance\OutsourceBill@update');
    Route::post('finance/outsourceBill/add', 'Finance\OutsourceBill@add');
    Route::post('finance/outsourceBill/del', 'Finance\OutsourceBill@del');
    Route::get('finance/outsourceBill/getList', 'Finance\OutsourceBill@getList');

    Route::get('finance/cashFlow/get', 'Finance\CashFlow@get');


    Route::get('inventory/purchase/getList', 'Inventory\Purchase@getList');
    Route::post('inventory/purchase/add', 'Inventory\Purchase@add');
    Route::post('inventory/purchase/update', 'Inventory\Purchase@update');
    Route::post('inventory/purchase/del', 'Inventory\Purchase@del');


    Route::get('system/date/getHasDate', 'System\Date@getHasDate');
    Route::get('system/date/getListByDate', 'System\Date@getListByDate');
    Route::post('system/date/add', 'System\Date@add');
    Route::post('system/date/del', 'System\Date@del');
});

// 这里是www.tiaofu.vip 下的预览
Route::get('/api/customer/getOrder', 'Api\Business\Order@customerGet');

// 工具相关
Route::namespace('Tool')->prefix('tool')->group(function() {
    Route::get('addAdmin', 'Admin@showAdd');
    Route::post('addAdmin', 'Admin@add');
    Route::post('collect/customer', 'Collect@saveCustomer');
    Route::get('collect/getCustomerList', 'Collect@getCustomerList');
    Route::get('collect/getPointList', 'Collect@getPointList');
    Route::get('fm/get-c-list', 'FileManager@getCustomerList');
});